<?php
session_start();
require_once("./include/membersite_config.php");
require_once("./include/Mobile_Detect.php");

$detect = new Mobile_Detect;
 
// Any mobile device (phones or tablets).
if ( $detect->isMobile() ) 
{
	$_SESSION['device'] = 'mobile' ;
	$_SESSION['main-div-left'] = 0;
	$_SESSION['main-div-center'] = 12;
	$_SESSION['main-div-right'] = 0;
}
// Any tablet device.
else if( $detect->isTablet() )
{
	$_SESSION['device'] = 'tablet' ;
	$_SESSION['main-div-left'] = 3;
	$_SESSION['main-div-center'] = 6;
	$_SESSION['main-div-right'] = 3;
}
// Exclude tablets.
else
{
	$_SESSION['device'] = 'pc' ;
	$_SESSION['main-div-left'] = 4;
	$_SESSION['main-div-center'] = 4;
	$_SESSION['main-div-right'] = 4;
}

if($_SESSION['cur_href'] != $fgmembersite->GetSelfScript())
{
	$_SESSION['pre_href'] = $_SESSION['cur_href'];
	$_SESSION['cur_href'] = $fgmembersite->GetSelfScript();
}
if($_SESSION['login'] == 0)
{
	$fgmembersite->RedirectToLoginURL();
}
?>
